Skip to content

Conversation

@iNem0o
Copy link
Contributor

@iNem0o iNem0o commented Jan 16, 2025

Hello

Here is the fix proposed in the DowngradeThrowExprRector logical error issue.

Why

When downgrading a coalesce operator that uses throw, there is a logical error in how the condition is generated. In the current implementation, the exception is thrown when the left-hand side is not null, but it should be thrown when the left-hand side is null.

@samsonasik
Copy link
Member

Please update fixtures under https://github.com/rectorphp/rector-downgrade-php/tree/main/rules-tests/DowngradePhp80/Rector/Expression/DowngradeThrowExprRector/Fixture and fix ci errors

@samsonasik
Copy link
Member

Could you add new fixture for the usecase you have?

@samsonasik
Copy link
Member

Oh, I see the fixture updated 👍

Copy link
Member

@samsonasik samsonasik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, let's give it a try 👍

@samsonasik samsonasik merged commit 2e0cde6 into rectorphp:main Jan 16, 2025
6 checks passed
@samsonasik
Copy link
Member

Thank you @iNem0o

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants